/* SmartInput Chrome扩展弹出窗口样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
    width: auto;
    min-width: 360px;
    max-width: 480px; /* 可根据实际需求调整 */
    margin: 0 auto; /* 居中显示 */
}

/* 紫色区域和绿色区域的样式调整 */
.popup-container .purple-section, .popup-container .green-section {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.purple-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.green-section {
    background: #4CAF50;
    color: white;
}

/* 确保按钮和文本在不同屏幕尺寸下都能正确显示 */
@media (max-width: 360px) {
    .voice-btn, .sync-btn, .action-btn {
        font-size: 12px;
        padding: 10px;
    }
    
    .activity-item {
        font-size: 10px;
    }
}

.popup-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* 确保最小高度为视口高度 */
}

/* 头部区域 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.logo .icon {
  font-size: 18px;
  animation: pulse 2s infinite;
}

.logo .title {
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.user-info.hidden {
  display: none;
}

.login-section.hidden {
  display: none;
}

.main-content.hidden {
  display: none;
}

.user-name {
  font-weight: 600;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.status-indicator:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.status-dot.connected {
  background: #4CAF50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
  animation: pulse 2s infinite;
}

.status-dot.disconnected {
  background: #f44336;
  box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

/* 登录和注册区域 */
.login-section {
  padding: 20px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  margin: 15px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.login-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}

.login-section h3 {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-section h3::before {
  content: '🔐';
  font-size: 18px;
}

.login-form {
  position: relative;
  z-index: 1;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.login-input::placeholder {
  color: #666;
}

.primary-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  position: relative;
  overflow: hidden;
}

.primary-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.primary-btn:hover::before {
  left: 100%;
}

.primary-btn:active {
  transform: translateY(0);
}

.login-error {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.login-error.error {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.login-error.success {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.form-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

.switch-text {
  margin-right: 8px;
}

.link-btn {
  background: none;
  border: none;
  color: white;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: all 0.3s ease;
  padding: 4px 8px;
  border-radius: 4px;
}

.link-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
  transform: scale(1.05);
}

.link-btn:active {
  color: #5a67d8;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* 主内容区域 */
.main-content {
  flex: 1;
  padding: 15px;
  overflow-y: auto; /* 实现内容自适应高度并可滚动 */
}

.main-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e9ecef;
}

/* 状态区域美化 */
.status-section {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 16px;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.status-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}

.status-section h3 {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-section h3::before {
  content: '📊';
  font-size: 16px;
}

.status-info {
  position: relative;
  z-index: 1;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  gap: 10px;
}

.status-item:last-child {
  border-bottom: none;
}

.status-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
}

.status-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 60px;
}

.status-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.status-value {
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-align: right;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: all 0.3s ease;
  word-break: break-all;
  white-space: normal;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
  max-width: none;
}

.status-value:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* 状态值特殊样式 */
.status-value.connected {
  background: rgba(76, 175, 80, 0.3);
  color: #4CAF50;
}

.status-value.disconnected {
  background: rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.status-value.loading {
  background: rgba(255, 193, 7, 0.3);
  color: #FFC107;
  animation: pulse 2s infinite;
}

/* 快捷操作区域 */
.quick-actions {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.quick-actions h3 {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-actions h3::before {
  content: '⚡';
  font-size: 16px;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  color: #333;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.action-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:active {
  transform: translateY(0);
}

.action-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.action-btn:hover .action-icon {
  transform: scale(1.1);
}

.action-text {
  font-weight: 600;
  text-align: center;
}

/* 最近活动区域 */
.recent-activity {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.recent-activity h3 {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-activity h3::before {
  content: '📝';
  font-size: 16px;
}

.activity-list {
  max-height: 120px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  font-size: 12px;
  color: white;
  border-radius: 6px;
  transition: all 0.3s ease;
  margin-bottom: 4px;
}

.activity-item:last-child {
  margin-bottom: 0;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.activity-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* 底部区域 */
.footer {
  padding: 12px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 11px;
  color: white;
  position: relative;
  overflow: hidden;
  gap: 10px;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}

.device-id {
  font-weight: 500;
  position: relative;
  z-index: 1;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: all 0.3s ease;
  word-break: break-all;
  white-space: normal;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
}

.device-id:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.02);
}

.version {
  font-weight: 600;
  position: relative;
  z-index: 1;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.version:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.02);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 360px) {
  body {
    width: 100%;
  }
  
  .popup-container {
    min-height: 100vh;
  }
  
  .action-btn {
    padding: 10px;
  }
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* 状态样式 */
.success {
  color: #4CAF50;
}

.error {
  color: #f44336;
}

.warning {
  color: #ff9800;
}

.info {
  color: #2196F3;
}

/* 按钮禁用状态 */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none;
}

/* 加载状态 */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
}

.error-notification {
  background: #f44336;
  color: white;
}

.success-notification {
  background: #4CAF50;
  color: white;
}

/* 屏幕阅读器专用样式 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}